home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Subtraction / card_4314.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  9.6 KB  |  430 lines

  1. -- card: 4314 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3967
  5. -- name: 
  6.  
  7.  
  8. -- part 6 (button)
  9. -- low flags: 00
  10. -- high flags: 8003
  11. -- rect: left=355 top=161 right=194 bottom=388
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: 7
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   get the length of field "Difference"
  23.   if it is 2 then exit mouseUp
  24.   add 1 to it
  25.   put "7" into char it of field "Difference"
  26. end mouseUp
  27.  
  28.  
  29.  
  30. -- part 7 (button)
  31. -- low flags: 00
  32. -- high flags: 8003
  33. -- rect: left=395 top=161 right=194 bottom=427
  34. -- title width / last selected line: 0
  35. -- icon id / first selected line: 0 / 0
  36. -- text alignment: 1
  37. -- font id: 0
  38. -- text size: 12
  39. -- style flags: 0
  40. -- line height: 16
  41. -- part name: 8
  42. ----- HyperTalk script -----
  43. on mouseUp
  44.   get the length of field "Difference"
  45.   if it is 2 then exit mouseUp
  46.   add 1 to it
  47.   put "8" into char it of field "Difference"
  48. end mouseUp
  49.  
  50.  
  51.  
  52. -- part 8 (button)
  53. -- low flags: 00
  54. -- high flags: 8003
  55. -- rect: left=435 top=162 right=194 bottom=467
  56. -- title width / last selected line: 0
  57. -- icon id / first selected line: 0 / 0
  58. -- text alignment: 1
  59. -- font id: 0
  60. -- text size: 12
  61. -- style flags: 0
  62. -- line height: 16
  63. -- part name: 9
  64. ----- HyperTalk script -----
  65. on mouseUp
  66.   get the length of field "Difference"
  67.   if it is 2 then exit mouseUp
  68.   add 1 to it
  69.   put "9" into char it of field "Difference"
  70. end mouseUp
  71.  
  72.  
  73.  
  74. -- part 9 (button)
  75. -- low flags: 00
  76. -- high flags: 8003
  77. -- rect: left=356 top=201 right=233 bottom=389
  78. -- title width / last selected line: 0
  79. -- icon id / first selected line: 0 / 0
  80. -- text alignment: 1
  81. -- font id: 0
  82. -- text size: 12
  83. -- style flags: 0
  84. -- line height: 16
  85. -- part name: 4
  86. ----- HyperTalk script -----
  87. on mouseUp
  88.   get the length of field "Difference"
  89.   if it is 2 then exit mouseUp
  90.   add 1 to it
  91.   put "4" into char it of field "Difference"
  92. end mouseUp
  93.  
  94.  
  95.  
  96. -- part 10 (button)
  97. -- low flags: 00
  98. -- high flags: 8003
  99. -- rect: left=395 top=202 right=234 bottom=428
  100. -- title width / last selected line: 0
  101. -- icon id / first selected line: 0 / 0
  102. -- text alignment: 1
  103. -- font id: 0
  104. -- text size: 12
  105. -- style flags: 0
  106. -- line height: 16
  107. -- part name: 5
  108. ----- HyperTalk script -----
  109. on mouseUp
  110.   get the length of field "Difference"
  111.   if it is 2 then exit mouseUp
  112.   add 1 to it
  113.   put "5" into char it of field "Difference"
  114. end mouseUp
  115.  
  116.  
  117.  
  118. -- part 11 (button)
  119. -- low flags: 00
  120. -- high flags: 8003
  121. -- rect: left=435 top=201 right=233 bottom=466
  122. -- title width / last selected line: 0
  123. -- icon id / first selected line: 0 / 0
  124. -- text alignment: 1
  125. -- font id: 0
  126. -- text size: 12
  127. -- style flags: 0
  128. -- line height: 16
  129. -- part name: 6
  130. ----- HyperTalk script -----
  131. on mouseUp
  132.   get the length of field "Difference"
  133.   if it is 2 then exit mouseUp
  134.   add 1 to it
  135.   put "6" into char it of field "Difference"
  136. end mouseUp
  137.  
  138.  
  139.  
  140. -- part 12 (button)
  141. -- low flags: 00
  142. -- high flags: 8003
  143. -- rect: left=356 top=242 right=274 bottom=389
  144. -- title width / last selected line: 0
  145. -- icon id / first selected line: 0 / 0
  146. -- text alignment: 1
  147. -- font id: 0
  148. -- text size: 12
  149. -- style flags: 0
  150. -- line height: 16
  151. -- part name: 1
  152. ----- HyperTalk script -----
  153. on mouseUp
  154.   get the length of field "Difference"
  155.   if it is 2 then exit mouseUp
  156.   add 1 to it
  157.   put "1" into char it of field "Difference"
  158. end mouseUp
  159.  
  160.  
  161.  
  162. -- part 13 (button)
  163. -- low flags: 00
  164. -- high flags: 8003
  165. -- rect: left=395 top=241 right=273 bottom=428
  166. -- title width / last selected line: 0
  167. -- icon id / first selected line: 0 / 0
  168. -- text alignment: 1
  169. -- font id: 0
  170. -- text size: 12
  171. -- style flags: 0
  172. -- line height: 16
  173. -- part name: 2
  174. ----- HyperTalk script -----
  175. on mouseUp
  176.   get the length of field "Difference"
  177.   if it is 2 then exit mouseUp
  178.   add 1 to it
  179.   put "2" into char it of field "Difference"
  180. end mouseUp
  181.  
  182.  
  183.  
  184. -- part 14 (button)
  185. -- low flags: 00
  186. -- high flags: 8003
  187. -- rect: left=436 top=242 right=274 bottom=468
  188. -- title width / last selected line: 0
  189. -- icon id / first selected line: 0 / 0
  190. -- text alignment: 1
  191. -- font id: 0
  192. -- text size: 12
  193. -- style flags: 0
  194. -- line height: 16
  195. -- part name: 3
  196. ----- HyperTalk script -----
  197. on mouseUp
  198.   get the length of field "Difference"
  199.   if it is 2 then exit mouseUp
  200.   add 1 to it
  201.   put "3" into char it of field "Difference"
  202. end mouseUp
  203.  
  204.  
  205.  
  206. -- part 15 (button)
  207. -- low flags: 00
  208. -- high flags: 8003
  209. -- rect: left=355 top=281 right=313 bottom=407
  210. -- title width / last selected line: 0
  211. -- icon id / first selected line: 0 / 0
  212. -- text alignment: 1
  213. -- font id: 0
  214. -- text size: 12
  215. -- style flags: 0
  216. -- line height: 16
  217. -- part name: 0
  218. ----- HyperTalk script -----
  219. on mouseUp
  220.   get the length of field "Difference"
  221.   if it is 2 then exit mouseUp
  222.   add 1 to it
  223.   put "0" into char it of field "Difference"
  224. end mouseUp
  225.  
  226.  
  227.  
  228. -- part 18 (button)
  229. -- low flags: 00
  230. -- high flags: 8003
  231. -- rect: left=354 top=102 right=139 bottom=468
  232. -- title width / last selected line: 0
  233. -- icon id / first selected line: 0 / 0
  234. -- text alignment: 1
  235. -- font id: 0
  236. -- text size: 12
  237. -- style flags: 0
  238. -- line height: 16
  239. -- part name: Next Problem
  240. ----- HyperTalk script -----
  241. on mouseUp
  242.   if field "Flag" = 0 then exit mouseUp
  243.   show button "Smiley"
  244.   show button "Frowney"
  245.   put empty into field "Comment"
  246.   put "  " into field "Minuend"
  247.   put "  " into field "Subtrahend"
  248.   put empty into field "Difference"
  249.   if field "Attempts" = second word of bkgnd field "Options" then
  250.     put field "Attempts" into attempts
  251.     put field "Correct" into correct
  252.     put field "Percent" into percent
  253.     put field "Name" into name
  254.     put third word of field "Options" into skill
  255.     put "O" into field "Attempts"
  256.     put "O" into field "Correct"
  257.     put "O" into field "Percent"
  258.     set the lockScreen to true
  259.     set the cursor to 4
  260.     go to first card of bkgnd "Users"
  261.     rotateData
  262.     put name into line 1 of field "name"
  263.     put the date into line 1 of field "Date"
  264.     put skill into line 1 of field "Skill"
  265.     put attempts into line 1 of field "Attempts"
  266.     put correct into line 1 of field "Correct"
  267.     put percent into line 1 of field "Percent"
  268.     pop card
  269.     exit mouseUp
  270.   end if
  271.   put the random of 9 into answer
  272.   get the random of 10
  273.   subtract 1 from it
  274.   put it into char 2 of field "Subtrahend"
  275.   put answer into temp
  276.   add field "Subtrahend" to temp
  277.   if temp<10 then
  278.     put temp into char 2 of field "Minuend"
  279.   else
  280.     put temp into field "Minuend"
  281.   end if
  282.   if answer < 10 then put " " into field "Difference"
  283.   put "0" into field "Flag"
  284. end mouseUp
  285.  
  286. on rotateData
  287.   repeat with x = 11 down to 1
  288.     if line x of field "Name" is empty then next repeat
  289.     put x into nextLine
  290.     add 1 to nextLine
  291.     get line x of field "Name"
  292.     put it into line nextLine of field "Name"
  293.     get line x of field "Date"
  294.     put it into line nextLine of field "Date"
  295.     get line x of field "Skill"
  296.     put it into line nextLine of field "Skill"
  297.     get line x of field "Attempts"
  298.     put it into line nextLine of field "Attempts"
  299.     get line x of field "Correct"
  300.     put it into line nextLine of field "Correct"
  301.     get line x of field "Percent"
  302.     put it into line nextLine of field "Percent"
  303.   end repeat
  304. end rotateData
  305.  
  306.  
  307.  
  308.  
  309. -- part 19 (button)
  310. -- low flags: 00
  311. -- high flags: 8003
  312. -- rect: left=414 top=281 right=313 bottom=468
  313. -- title width / last selected line: 0
  314. -- icon id / first selected line: 0 / 0
  315. -- text alignment: 1
  316. -- font id: 0
  317. -- text size: 12
  318. -- style flags: 0
  319. -- line height: 16
  320. -- part name: Enter
  321. ----- HyperTalk script -----
  322. on mouseUp
  323.   global answer
  324.   if field "Difference" < 0 then exit mouseUp
  325.   if field "Flag" > 0 then exit mouseUp
  326.   put field "Minuend" into answer
  327.   subtract field "Subtrahend" from answer
  328.   add 1 to field "Attempts"
  329.   if field "Difference" = answer then
  330.     add 1 to field "Correct"
  331.     get field "Correct"
  332.     divide it by field "Attempts"
  333.     multiply it by 100
  334.     put round(it) into field "Percent"
  335.     celebrate
  336.   else
  337.     get field "Correct"
  338.     divide it by field "Attempts"
  339.     multiply it by 100
  340.     put round(it) into field "Percent"
  341.     nag
  342.   end if
  343. end mouseUp
  344.  
  345. on celebrate
  346.   put "Correct" into line 1 of field "Comment"
  347.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  348.   hide button "Smiley"
  349.   put "1" into field "Flag"
  350.   if first word of bkgnd field "Options" = "Y" then
  351.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  352.   end if
  353. end celebrate
  354.  
  355. on nag
  356.   global answer
  357.   put "WRONG!" into line 1 of field "Comment"
  358.   put "The answer is "& answer & "." into line 3 of field "Comment"
  359.   hide button "Frowney"
  360.   put "2" into field "Flag"
  361.   if first word of bkgnd field "Options" = "Y" then
  362.     play "boing" tempo 200 "gq c e a"
  363.   end if
  364. end nag
  365.  
  366.  
  367.  
  368. -- part 23 (button)
  369. -- low flags: 00
  370. -- high flags: 0001
  371. -- rect: left=21 top=87 right=180 bottom=121
  372. -- title width / last selected line: 0
  373. -- icon id / first selected line: 0 / 0
  374. -- text alignment: 1
  375. -- font id: 0
  376. -- text size: 12
  377. -- style flags: 0
  378. -- line height: 16
  379. -- part name: Smiley
  380.  
  381.  
  382. -- part 24 (button)
  383. -- low flags: 00
  384. -- high flags: 0001
  385. -- rect: left=234 top=87 right=180 bottom=334
  386. -- title width / last selected line: 0
  387. -- icon id / first selected line: 0 / 0
  388. -- text alignment: 1
  389. -- font id: 0
  390. -- text size: 12
  391. -- style flags: 0
  392. -- line height: 16
  393. -- part name: Frowney
  394.  
  395.  
  396. -- part contents for background part 1
  397. ----- text -----
  398. 10
  399.  
  400. -- part contents for background part 2
  401. ----- text -----
  402.  8
  403.  
  404. -- part contents for background part 5
  405. ----- text -----
  406. 2
  407.  
  408. -- part contents for background part 6
  409. ----- text -----
  410. 2
  411.  
  412. -- part contents for background part 7
  413. ----- text -----
  414. 100
  415.  
  416. -- part contents for background part 9
  417. ----- text -----
  418. 0
  419.  
  420. -- part contents for background part 14
  421. ----- text -----
  422. Y 10 1
  423.  
  424. -- part contents for background part 15
  425. ----- text -----
  426. Larry
  427.  
  428. -- part contents for background part 3
  429. ----- text -----
  430.